<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="../css/pageStyle/page.css"/>
	</head>

	<body>
		<div class="mui-content" id="muiContent">
			<div id="scroll1" class="mui-scroll-wrapper mui-slider-item">
				<div class="mui-scroll">
					<ul class="mui-table-view">
						<li class="mui-table-items" v-for="list in ordersList">
							<div class="name_status">
								<img v-bind="{ src:list.shopList.logo}" />
								<p class="name">{{ list.shopList.name }}</p>&nbsp;&gt;
								<p class="status">{{ list.orderList.status }}</p>
							</div>
							<div class="lists">
								<p v-for="(itemlist,index) in list.orderItemList" v-if="index<3">{{ itemlist.name }}<span>X{{ itemlist.num }}</span></p>
								<p><span class="sum" v-if="list.total>3">...</span><span>共{{ list.total }}件商品，实付 <b>￥{{ list.orderList.payment }}</b></span></p>
							</div>
							<div class="btn">
								<a class="org">评价</a>
								<a>再来一单</a>
							</div>
						</li>

					</ul>
				</div>
			</div>
		</div>
	</body>
	<script src="../js/mui.min.js"></script>
	<script src="../js/server.js" type="text/javascript" charset="utf-8"></script>
	<script src="../js/jquery-1.8.3.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="../js/vue.js" type="text/javascript" charset="utf-8"></script>
	<script>
		var vm = new Vue({
			el: '#muiContent',
			data: {
				ordersList: [],
				waitEvaluateList: [],
				cancelList: []
			},
			mounted: function() {
				this.init();
				this.getOrderList();
			},
			methods: {
				init: function() {
					mui.init({
						pullRefresh: {
							container: ".mui-content", //下拉刷新容器标识，querySelector能定位的css选择器均可，比如：id、.class等
							down: {
								style: 'circle', //必选，下拉刷新样式，目前支持原生5+ ‘circle’ 样式
								color: '#2BD009', //可选，默认“#2BD009” 下拉刷新控件颜色
								height: '88px', //可选,默认50px.下拉刷新控件的高度,
								range: '100px', //可选 默认100px,控件可下拉拖拽的范围
								offset: '0', //可选 默认0px,下拉刷新控件的起始位置
								auto: true, //可选,默认false.首次加载自动上拉刷新一次
								callback: this.getOrderList //必选，刷新函数，根据具体业务来编写，比如通过ajax从服务器获取新数据							}
							}
						}
					});
				},
				update: function(serverUrl, dataBox) {
					console.log(serverUrl)
					mui.ajax(serverUrl, {
						type: 'get',
						dataType: 'json',
						success: function(res) {
							console.log(res)
							vm.dataBox = res.rows
						},
						error: function(type) {
							console.log('错误:' + type)
						}
					})
				},
				getOrderList: function() {
					$.ajax({
						url: server + "/order/waitEvaluateList",
						type: "get",
						dataType: 'json',
						async: true,
						success: function(res) {
							console.log(res)
							vm.ordersList = res.rows;
							mui('.mui-content').pullRefresh().endPulldown(); // 下拉结束   初始化下拉
						},
						error: function(type) {
							console.log(type)
						}
					});
				}
			}
		})
	</script>

</html>